package com.woniu.pojo;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * user
 * @author 
 */
public class User implements Serializable {



    private List<Userrole> userroleList;

    public List<Userrole> getUserroleList() {
        return userroleList;
    }

    public void setUserroleList(List<Userrole> userroleList) {
        this.userroleList = userroleList;
    }

    /**
     * 用户id
     */
    private Integer uid;

    /**
     * 姓名
     */
    private String uname;

    /**
     * 软删除
     */
    private String softdel;

    /**
     * 状态
     */
    private String ustate;

    /**
     * 密码
     */
    //@Size(max = 6,min = 3,message = "密码应该再3-6位")
    @NotBlank
    private String upwd;

    /**
     * 地区
     */
    private String area;

    /**
     * 账号
     */
    @Size(max = 13,min = 2,message = "账号长度不符合")
    private String uaccount;

    /**
     * 手机号
     */
    @Size(max = 12,min = 10,message = "手机号不符合规则")
    private String uphone;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 人脸id
     */
    private String faceid;

    private static final long serialVersionUID = 1L;

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getUname() {
        return uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public String getSoftdel() {
        return softdel;
    }

    public void setSoftdel(String softdel) {
        this.softdel = softdel;
    }

    public String getUstate() {
        return ustate;
    }

    public void setUstate(String ustate) {
        this.ustate = ustate;
    }

    public String getUpwd() {
        return upwd;
    }

    public void setUpwd(String upwd) {
        this.upwd = upwd;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getUaccount() {
        return uaccount;
    }

    public void setUaccount(String uaccount) {
        this.uaccount = uaccount;
    }

    public String getUphone() {
        return uphone;
    }

    public void setUphone(String uphone) {
        this.uphone = uphone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getFaceid() {
        return faceid;
    }

    public void setFaceid(String faceid) {
        this.faceid = faceid;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        User other = (User) that;
        return (this.getUid() == null ? other.getUid() == null : this.getUid().equals(other.getUid()))
            && (this.getUname() == null ? other.getUname() == null : this.getUname().equals(other.getUname()))
            && (this.getSoftdel() == null ? other.getSoftdel() == null : this.getSoftdel().equals(other.getSoftdel()))
            && (this.getUstate() == null ? other.getUstate() == null : this.getUstate().equals(other.getUstate()))
            && (this.getUpwd() == null ? other.getUpwd() == null : this.getUpwd().equals(other.getUpwd()))
            && (this.getArea() == null ? other.getArea() == null : this.getArea().equals(other.getArea()))
            && (this.getUaccount() == null ? other.getUaccount() == null : this.getUaccount().equals(other.getUaccount()))
            && (this.getUphone() == null ? other.getUphone() == null : this.getUphone().equals(other.getUphone()))
            && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
            && (this.getFaceid() == null ? other.getFaceid() == null : this.getFaceid().equals(other.getFaceid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUid() == null) ? 0 : getUid().hashCode());
        result = prime * result + ((getUname() == null) ? 0 : getUname().hashCode());
        result = prime * result + ((getSoftdel() == null) ? 0 : getSoftdel().hashCode());
        result = prime * result + ((getUstate() == null) ? 0 : getUstate().hashCode());
        result = prime * result + ((getUpwd() == null) ? 0 : getUpwd().hashCode());
        result = prime * result + ((getArea() == null) ? 0 : getArea().hashCode());
        result = prime * result + ((getUaccount() == null) ? 0 : getUaccount().hashCode());
        result = prime * result + ((getUphone() == null) ? 0 : getUphone().hashCode());
        result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
        result = prime * result + ((getFaceid() == null) ? 0 : getFaceid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", uid=").append(uid);
        sb.append(", uname=").append(uname);
        sb.append(", softdel=").append(softdel);
        sb.append(", ustate=").append(ustate);
        sb.append(", upwd=").append(upwd);
        sb.append(", area=").append(area);
        sb.append(", uaccount=").append(uaccount);
        sb.append(", uphone=").append(uphone);
        sb.append(", email=").append(email);
        sb.append(", faceid=").append(faceid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}